package JAVA;

public class work3113 {
    public static void main(String[] args) {
        //3、int[] arr = { 1, 2, 3, 4, 5, 6, 4, 7, 2, 10 };将给的整型数组中的重复元素保留一个。
        int[] arr = {1, 2, 3, 4, 5, 6, 4, 7, 2, 10};
        int[] arr1 = new int[arr.length];
        int count = 0;

        for (int x = 0; x < arr.length; x++) {
            boolean isOne = true;
            for (int y = x + 1; y < arr.length; y++) {
                if (arr[x] == arr[y]) {
                    isOne = false;
                    break;
                }
            }
            if (isOne) {
                arr1[x] = arr[x];
            }
            System.out.println(arr1[x]);
        }
    }
}
